﻿<classes:Layers
    x:Class="MemoBoss.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:util="clr-namespace:Util"
    xmlns:adduplex="clr-namespace:AdDuplex;assembly=AdDuplex.WindowsPhone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
     xmlns:classes="clr-namespace:Classes"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="[MemoBoss];component/Fonts/[OutlineTwelve]#[OutlineTwelve]"

  
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <Storyboard x:Name="Push">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="btnOptionsGrid">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="0.9"/>

            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="btnOptionsGrid">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="0.9"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="Release">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="btnOptionsGrid">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.9"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="btnOptionsGrid">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.9"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="HideMainMenu">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MainMenu">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="MainMenu">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-500"/>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="MainMenu">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>-->
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MainMenu">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Visibility.Collapsed"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="ShowMainMenu" Completed="ShowMainMenu_Completed" >
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MainMenu">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="MainMenu">
                <EasingDoubleKeyFrame KeyTime="0" Value="-500"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="MainMenu">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>-->
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MainMenu">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Visibility.Visible"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="HideMainPage">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MainPageContent">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="MainPageContent">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-500"/>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="MainPageContent">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>-->
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MainPageContent">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Visibility.Collapsed"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="ShowMainPage" Completed="ShowMainPage_Completed">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MainPageContent">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="MainPageContent">
                <EasingDoubleKeyFrame KeyTime="0" Value="-500"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="MainPageContent">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>-->
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MainPageContent">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Visibility.Visible"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" Loaded="LayoutRoot_Loaded">
        <!--ContentPanel - place additional content here-->
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <Grid x:Name="ContentPanel"  util:Clip.ToBounds="true" >

            <Image Tag="LayerIndex=-30" CacheMode="BitmapCache"  x:Name="bgImage1"  Opacity="0"  Margin="-50" HorizontalAlignment="Center"  VerticalAlignment="Center" Stretch="UniformToFill" />
            <Image Tag="LayerIndex=-30" CacheMode="BitmapCache" x:Name="bgImage2"  Opacity="0" Margin="-50" HorizontalAlignment="Center"  VerticalAlignment="Center" Stretch="UniformToFill" />
            
            <Grid Background="#6E000000"  RenderTransformOrigin="0.5,0.5" >

                <Grid x:Name="MainPageContent" CacheMode="BitmapCache">
                    <Grid.RenderTransform>
                        <TranslateTransform/>
                    </Grid.RenderTransform>


                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <!--<TextBlock Tag="LayerIndex=20" x:Name="PageTitle" Text="memory+" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Foreground="#FFFFDEF2" FontStretch="Normal" FontSize="100" FontFamily="Fonts/OutlineTwelve.ttf#OutlineTwelve" />-->
                    <Image x:Name="logoImage" Grid.Row="0" Tag="LayerIndex=30" Source="/Images/logo.png" Margin="50,30,50,0"></Image>
                    <!--<Grid Grid.Row="1" Margin="30,100,30,0"  x:Name="GameLoadingBar" VerticalAlignment="Top">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock  FontSize="20" TextAlignment="Center" VerticalAlignment="Top">loading...</TextBlock>
                        <Rectangle Grid.Row="0" Grid.RowSpan="2" RenderTransformOrigin="0.5,0.5"  Opacity="0.7">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource PhoneAccentColor}"></SolidColorBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        
                        <Rectangle Grid.Row="1" Height="10" Margin="5"  Fill="{StaticResource PhoneForegroundBrush}" RenderTransformOrigin="0,0" >
                            <Rectangle.RenderTransform>
                                <ScaleTransform x:Name="GameProgressTransform"/>
                            </Rectangle.RenderTransform>
                        </Rectangle>

                    </Grid>-->
                    <Grid x:Name="MenuPlaceholder" Grid.Row="1" Tag="LayerIndex=10">
                        <Grid x:Name="MainMenu" CacheMode="BitmapCache" RenderTransformOrigin="0,0.5">
                            <Grid.RenderTransform>
                                <TranslateTransform/>
                            </Grid.RenderTransform>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="8*"/>
                                <ColumnDefinition Width="2*"/>
                            </Grid.ColumnDefinitions>
                            <Grid >
                                <StackPanel>


                                    <Grid Margin="30,20,30,0"  RenderTransformOrigin="0.5,0.5"  MouseLeftButtonDown="btnOptionsGrid_MouseLeftButtonDown"  MouseLeave="btnOptionsGrid_MouseLeave">
                                        <Grid.RenderTransform>
                                            <ScaleTransform/>
                                        </Grid.RenderTransform>
                                        <Rectangle x:Name="btnPlay" Opacity="0.9" RenderTransformOrigin="0.5,0.5" Tap="btnPlay_Tap">
                                            <Rectangle.Fill>
                                                <ImageBrush ImageSource="/Images/menu1.png" />
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Image x:Name="imgStop"  Margin="0,0,30,0" Source="/Images/NotEnough.png"   Stretch="None" HorizontalAlignment="Right" IsHitTestVisible="False"/>

                                        <TextBlock Margin="20,20,20,20" FontSize="50" TextAlignment="Center" FontFamily="Fonts/OutlineTwelve.ttf#OutlineTwelve" IsHitTestVisible="False">play</TextBlock>
                                    </Grid>

                                    <Grid Margin="30,20,30,0"  RenderTransformOrigin="0.5,0.5"  MouseLeftButtonDown="btnOptionsGrid_MouseLeftButtonDown"  MouseLeave="btnOptionsGrid_MouseLeave">

                                        <Grid.RenderTransform>
                                            <ScaleTransform/>
                                        </Grid.RenderTransform>
                                        <Rectangle  x:Name="btnOptions" RenderTransformOrigin="0.5,0.5" Opacity="0.9" Tap="btnOptions_Tap">
                                            <Rectangle.Fill>
                                                <ImageBrush ImageSource="/Images/menu2.png" />
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <TextBlock Margin="20,20,20,20" FontSize="50" TextAlignment="Center" FontFamily="Fonts/OutlineTwelve.ttf#OutlineTwelve" IsHitTestVisible="False">options</TextBlock>
                                    </Grid>

                                    <Grid Margin="30,20,30,0" RenderTransformOrigin="0.5,0.5"  MouseLeftButtonDown="btnOptionsGrid_MouseLeftButtonDown"  MouseLeave="btnOptionsGrid_MouseLeave">
                                        <Grid.RenderTransform>
                                            <ScaleTransform/>
                                        </Grid.RenderTransform>
                                        <Rectangle x:Name="btnScoreboard" Opacity="0.9" RenderTransformOrigin="0.5,0.5" Tap="btnScoreboard_Tap">
                                            <Rectangle.Fill>
                                                <ImageBrush ImageSource="/Images/menu3.png" />
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <TextBlock Margin="20,20,20,20" FontSize="40" TextAlignment="Center" FontFamily="Fonts/OutlineTwelve.ttf#OutlineTwelve" IsHitTestVisible="False">Scoreboard</TextBlock>
                                    </Grid>
                                </StackPanel>
                            </Grid>
                            <StackPanel Grid.Column="2" x:Name="ButtonsPanel" Margin="12,12,12,12" VerticalAlignment="Top">
                                <Image  Margin="0,10,0,5" Name="btnHelp" Stretch="None" Source="/Icons/question.png" Tap="btnHelp_Tap" />
                                <TextBlock Foreground="#FFFFDEF2"  Text="Help"  FontSize="12" TextAlignment="Center"/>
                                <Image  Margin="0,10,0,5" Name="btnAbout" Stretch="None" Source="/Icons/about.png" Tap="btnAbout_Tap" />
                                <TextBlock Foreground="#FFFFDEF2"  Text="About"  FontSize="12" TextAlignment="Center"/>
                                <Image  Margin="0,10,0,5" Name="btnRate" Stretch="None" Source="/Icons/rate.png" Tap="btnRate_Tap" />
                                <TextBlock Foreground="#FFFFDEF2"  Text="Rate"  FontSize="12" TextAlignment="Center"/>
                                <Image Margin="0,10,0,5"  Name="btnBuy" Stretch="None" Source="/Icons/cart.png" Tap="btnBuy_Tap" />
                                <TextBlock Foreground="#FFFFDEF2" Name="txtBuy" Text="Buy"  FontSize="12" TextAlignment="Center"/>
                                <Image  Margin="0,10,0,5" Name="btnFacebook" Stretch="None" Source="/Icons/facebook.png" Tap="btnFacebook_Tap" />
                                <TextBlock Foreground="#FFFFDEF2"  Text="Facebook"  FontSize="12" TextAlignment="Center"/>

                            </StackPanel>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>
        <MediaElement x:Name="BGMusic" Volume="1" AutoPlay="False" ></MediaElement>
        <adduplex:AdControl 
                            x:Name="AdDuplex"
                            IsTest="False"
                            Grid.Row="2" 
                            AppId="20563" />
        
    </Grid>
    

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</classes:Layers>